/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
import scanner.*;
import Parser.*;

/**
 *
 * @author Fabulous
 */
public class Project2Main {
    
    public static void main(String[] args) {
        try {
            // create output file
            PrintWriter output = new PrintWriter("result.txt");

            // get input file
            File file = new File("testcode.c");
            FileReader reader = new FileReader(file);
            BufferedReader inFile = new BufferedReader(reader);
            Scanner scan = new CMinusScanner(inFile);
            Parser parser = new CMinusParser(scan);
            parser.parse();
            parser.printTree(output);
            output.close();

        } catch (Exception e) {
                System.out.println("ERROR: " + e);
        }
    }
}
